package algorithms.que14;

/**
 * @功能
 * @创建时间 2020/9/13
 */
public class E1d4d33 {
    int leng;
    public void ans1(int[] arr,int a){
        int len=arr.length;
        int lo=0;
        int hi=len-1;
        int ral=1;
        int rar=1;

        while (rar<len){
            rar=ral+rar;
            ral=rar-ral;
        }
        int mid;
        while (lo<hi){
            mid=lo+rar-ral-1;
            if(arr[mid]>a){
                hi=mid-1;
                rar=rar-ral;
                ral=ral-rar;
            }
            if(arr[mid]<a){
                lo=mid+1;
                ral=rar-ral;
                rar=rar-ral;
            }
        }
    }
}
